package java67_adv5;

public class Role implements Comparable<Role> {
	private String name;
	private int living;
	private int defense;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getLiving() {
		return living;
	}

	public void setLiving(int living) {
		this.living = living;
	}

	public int getDefense() {
		return defense;
	}

	public void setDefense(int defense) {
		this.defense = defense;
	}

	public void catchShield(Shield s) {
		this.setDefense(this.getDefense() + s.getDefense());
		s.setDefense(0);// !!!!!!!!!
	}

	@Override
	public int compareTo(Role o) {
		return this.defense - o.defense;
	}
}
